home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / c_lib.arc / FLSETDTA.C < prev    next >
Text File  |  1990-08-09  |  1KB  |  48 lines

  1. /**
  2. *
  3. *  Name         flsetdta -- Set the Disk Transfer Area (DTA) location
  4. *
  5. *  Synopsis     ercode = flsetdta(pdta_ads);
  6. *               int ercode        DOS function return code
  7. *               ADS *pdta_ads     Segment, offset address for the DTA
  8. *
  9. *  Description  Many of the DOS functions use the Disk Transfer Area
  10. *               for buffering I/O and other functions (see DRSFIRST).
  11. *               The DTA is a 128 bytes buffer, and this function sets
  12. *               its location to the area pointed to by the segment offset
  13. *               address in pdta_ads.
  14. *
  15. *  Returns      ercode            DOS function return code (always 0).
  16. *
  17. *  Version      1.1  (C)Copyright Blaise Computing Inc.  1983, 1984
  18. *
  19. **/
  20. struct segads                          /* Segment,offset address type  */
  21. {
  22.   unsigned r;
  23.   unsigned s;
  24. };
  25. #define ADS     struct segads          /* Abbreviation                 */
  26.  
  27. struct dreg
  28. {
  29.   unsigned ax,bx,cx,dx,si,di,ds,es;
  30. };
  31. #define DOSREG  struct dreg
  32.  
  33. int flsetdta(pdta_ads)
  34. ADS *pdta_ads;
  35. {
  36.  
  37.     DOSREG dos_reg;
  38.     int    utinit(),dos();
  39.  
  40.     utinit(&dos_reg);                  /* Initialize registers         */
  41.     dos_reg.ax = 0x1a00;               /* DOS function 1A              */
  42.     dos_reg.ds = pdta_ads->s;
  43.     dos_reg.dx = pdta_ads->r;
  44.  
  45.     return(dos(&dos_reg));
  46.  
  47. }
  48.